﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace ZhaoPin.Business
{
    public class PersonState
    {
        Person person;
        public PersonState(Guid guid)
        {
            RecruitContainer rc = new RecruitContainer();
            var m = from p in rc.People where p.Id.Equals(guid) select p;
            person = m.SingleOrDefault();
            rc.Dispose();
        }
        public string GetRealName()
        {
            return person.RealName;
        }
        public string GetCheckState()
        {
            if (!person.IsFilledTable)
            {
                return "还未填写报名表，请先填写报名表";
            }
            else if (!person.IsChecked)
            {
                return "还未审核，请等待审核";
            }
            else if (person.IsCheckedOk)
            {
                if (!person.IsPaid)
                {
                    return "已通过审核，请缴费";
                }
                else
                {
                    return "已通过审核，已缴费，请注意按通知打印准考证和所需材料";
                }
            }
            else if (person.IsCanRefillTable)
            {
                return "审核不通过，请修改报名表！";
            }
            else
            {
                return "审核不通过，取消报名资格！";
            }
        }
    }
}